home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Unix / Shells / zsh / Source / src / config / bz.Makefile < prev    next >
Encoding:
Makefile  |  1994-04-07  |  7.3 KB  |  316 lines

  1. # --- ${C_BLDDIR}Makefile
  2.  
  3. if test -n "$B_Makefile"
  4. then
  5.  
  6. F_define=
  7. F_using=yep
  8.  
  9. cat <<foo
  10.  
  11. Building $MAKEFILE...
  12.  
  13. foo
  14.  
  15. # configure the needed variables
  16.  
  17. test -z "$make_probe_done" && . bz.makeprobe
  18.  
  19. # just build it!
  20.  
  21. (exec >$MAKEFILE
  22. cat <<foo
  23. #! /bin/make -f
  24. # Makefile
  25. # architecture-customized Makefile for $VERSION
  26. # for architecture "$arch",
  27. # automagically generated by buildzsh -- do not edit
  28.  
  29. MAKE=make
  30.  
  31. AUX=buildzsh
  32.  
  33. SRC=$SRC
  34.  
  35. HEADER=$HEADER
  36.  
  37. PROTO=$PROTO
  38.  
  39. OBJS=$OBJS
  40.  
  41. BINDIR=$C_BINDIR
  42. MANDIR=$C_MANDIR
  43.  
  44. # Debugging flags
  45. DFLAGS=$DFLAGS
  46.  
  47. CC=$CC
  48.  
  49. CFLAGS=$CFLAGS
  50.  
  51. CFLAGS_WO_O=$CFLAGS_WO_O
  52.  
  53. LD=$LD
  54.  
  55. LDFLAGS=$LDFLAGS
  56.  
  57. LIBS=$LIBS
  58.  
  59. ZSHPATH=${C_BLDDIR}zsh
  60.  
  61. all: \$(PROTO) \$(ZSHPATH)
  62.  
  63. .SUFFIXES: .c .o .pro
  64.  
  65. foo
  66.  
  67. echo '    ...possible notes' 1>&2
  68.  
  69. echo '    ...special rules' 1>&2
  70.  
  71. # --- notes for various environments (and compilers)
  72.  
  73. # Past problems: (PLEASE COLLECT PAST PROBLEMS WITH COMPILERS
  74. # HERE: NOT ERRORS/WARNINGS BUT STUFF ABOUT COMPILER CRASHES AND SUCH)
  75. #
  76. # AIX c89 -O -c builtin.c/2.4.60...2.4.2xx used to dump core,
  77. # AIX 3.2.4 fixes the situation, harass your IBM rep until you get the patches.
  78. # (the temporary patch is to use cc on builtin.c)
  79. #
  80. # IRIX cc -ansiposix -O zle_misc.c/2.4.75..2.4.2xx used to dump core,
  81. # later zsh patchlevels do not have this problem
  82. # (the temporary patch was to drop -O on zle_misc.c)
  83. #
  84.  
  85. if test -n "$AIX"
  86. then
  87. cat <<foo
  88. #    --- AIX notes
  89. #    Note 1:    Pre-3.2.4 AIX c89 -O -c builtin.c dumps core,
  90. #        the temporary cure is to use cc on builtin.c.
  91. #
  92. #    Note 2: 3.2.4-onwards AIX cc -O builtin.c gets stuck (optimizer
  93. #        tries too hard), the temporary cure is to drop -O.
  94. #
  95. # @@@ NOTE: won't work if srcdir != blddir
  96. ${C_BLDDIR}builtin.o:     ${C_SRCDIR}builtin.c
  97.     cc \$(CFLAGS_WO_O) \$(DFLAGS) -o builtin.o -c builtin.c
  98.  
  99. foo
  100. elif test -n "$HPUX"
  101. then
  102. cat <<'foo'
  103. #    --- HPUX notes
  104. #    With c89 you will get warnings ftom
  105. #    from zle_tricky.c: warning 530: Casting from loose to strict alignment.
  106. #    this problem is caused by casting "char *"s to e.g. Cmdnam-
  107. #    structures and then immediately accessing the elements, like this: 
  108. #    char *s;
  109. #    char *cn;
  110. #    {
  111. #        if (((Cmdnam) cn)->type != DISABLED)
  112. #
  113. foo
  114. elif test -n "$CONVEX"
  115. then
  116. cat <<'foo'
  117. #    --- CONVEX notes
  118. #    cc options NOT used:
  119. #    -std (strict ANSI + POSIX, non-POSIX not recognized, e.g. long long)
  120. #    -str (strict ANSI, UNIX functions not recognized)
  121. #    diagnostics not used (zsh code too "hopeless"):
  122. #    assign_in_condition metrics_file metrics_off
  123. #    negative_to_uns pointer_alignment_efficiency skip_to_char skip_to_eof
  124. #    Note 1: man cc lies that ptr_cvt_truncates is ptr_convert_truncates
  125. #    Note 2: cc notices that init.c:main() never returns
  126. #    Note 3: utils.c:intr() and holdintr() sigvec initializations
  127. #            are somehow suspicious
  128. #
  129. foo
  130. elif test -n "$SOLARIS"
  131. then
  132. cat <<'foo'
  133. #    --- SOLARIS notes
  134. #    SunSoft cc assumed (CFLAGS derived from this assumption),
  135. #    if you want to use gcc, try 'buildzsh gcc'
  136. foo
  137. elif test -n "$NEXT"
  138. then
  139. cat <<'foo'
  140. #    --- NEXT notes
  141. #    You will get two warnings for each file because
  142. #    /NextDeveloper/Headers/bsd/memory.h:23 contains
  143. #    ANSI-illegal trash after #endif.
  144. #
  145. foo
  146. elif test -n "$UNICOS"
  147. then
  148. cat <<'foo'
  149. #    --- UNICOS notes
  150. #    Note 1: you will get five WARNINGs for each file because of
  151. #            a) <sys/param.h>, <sys/ioctl.h>:
  152. #           there is something else than just newline after
  153. #           directives #endif or #else (Cray's fault)
  154. #    It *is* possible to get more picky by adding '-h port=insx'
  155. #    to the CFLAGS but then a horde of complaints will jump at you:
  156. #    Note 2: a) <stdio.h>:
  157. #           use bit fields other than signed int or unsigned int
  158. #            b) <sys/file.h>:
  159. #           union members have different types
  160. #            b1) f_uinode and f_udata
  161. #            b2) f_unext and f_udata
  162. #            (both of these Cray's fault)
  163. #    Note 3: zsh.h: union members have different types
  164. #            a1) nam and binnum    a5) arr and val
  165. #            a2) nam and list        a6) str and val
  166. #            a3) binnum and list    a7) cfn and ifn
  167. #            a4) arr and str        a8) ifn and afn
  168. #            b) cond.c:
  169. #            pointer is cast to a pointer of another type
  170. #    Note 4: from most of the zsh source files LOTS of:
  171. #            a) an assignment to a shorter integral type may cause truncation
  172. #            b) an integral type is cast to  pointer
  173. #            c) a character pointer cast may result in improprer alignment
  174. #            d) a "char" assigned to a larger "int" may sign-extend incorrectly
  175. #
  176. foo
  177. # IRIX5 test before IRIX test because IRIX5 is also IRIX but we
  178. # want IRIX5-specific stuff here
  179. elif test -n "$IRIX5"
  180. then
  181. cat <<'foo'
  182. #    -- IRIX5 notes
  183. #    Warnings turned off:
  184. #    799: /usr/include/sgidefs.h, line 141: 'long long' is not standard ANSI. (3.1.1)
  185. #
  186. foo
  187. elif test -n "$IRIX"
  188. then
  189. cat <<'foo'
  190. #    --- IRIX notes
  191. #    Warnings turned off:
  192. #      2: %s redefinition hides earlier one
  193. #         (all the static-global c's, sigh...)
  194. #    183: Previous declaration had prototype, this declaration does not(prototype declaration kept)
  195. #         (ANSI *.pro vs K&R *.c)
  196. #    262: Previous declaration had prototype, this definition does not
  197. #         (ditto)
  198. #    269: Evaluation gives an intermediate result type difference in ANSI versus K&R C;   int  versus   unsigned int
  199. #         (all the unsigned staff vs char and int literals, ugh)
  200. #    302: bodyless for statement
  201. #         (not bad at all, just suspicious)
  202. #    303: bodyless while statement
  203. #         (not bad at all, just suspicious)
  204. #    309: Only int, signed int, unsigned int bit-fields defined in ANSI C. char, short, and long versions are allowed as an extension (ANSI C 3.5.2.1)
  205. #         (one of IRIX' own header files is bad in this way...)
  206. #
  207. foo
  208. elif test -n "$TITAN"
  209. then
  210. cat <<'foo'
  211. #    --- TITAN notes
  212. #    Note 1: lots of (about 125) of "argument xxx is not used"
  213. #    Note 2: LOTS of (about 420) of "conversion of xxx (0xyy) loses precision
  214. #    Note 3: couple of (3) of "implied return [blah blah]"
  215. #        (caused by poor flow analysis, not by poor code)
  216. #
  217. foo
  218. fi
  219.  
  220. echo '    ...general rules' 1>&2
  221.  
  222. if test -n "$ccseparate"
  223. then
  224.   if test -n "$make_groks_VPATH"
  225.   then
  226.     for _b in $BSRC
  227.     do
  228. cat <<foo
  229. $_b.o:    $_b.c
  230.     $ccit -c \$?
  231.  
  232. foo
  233.     done
  234.   else
  235.     for _b in $BSRC
  236.     do
  237. cat <<foo
  238. $_b.o:    $C_SRCDIR/$_b.c
  239.     $ccit -c \$?
  240.  
  241. foo
  242.      done
  243.   fi
  244. else    # the simple case
  245. cat <<foo
  246. .c.o:
  247.     $ccit $ccdotc
  248.  
  249. foo
  250. fi
  251.  
  252. if test -z "$make_groks_VPATH"
  253. then
  254.   for _proto in $PROTO
  255.   do
  256.     _c=`basename $_proto|sed 's/pro$/c/`
  257. cat <<foo
  258. $_proto:
  259.     sed -n -f makepro.sed $_c > $_proto
  260.  
  261. foo
  262.   done
  263. else
  264.  
  265. cat <<foo
  266.  
  267. .c.pro:
  268.     sed -n -f makepro.sed ${C_SRCDIR}$< > \`basename ${C_BLDDIR}\$@\`
  269.  
  270. foo
  271. fi
  272.  
  273. cat <<foo
  274. \$(ZSHPATH): \$(OBJS)
  275.     \$(LD) \$(LDFLAGS) -o \$(ZSHPATH) \$(OBJS) \$(LIBS)
  276.     
  277. \$(PROTO): ${C_SRCDIR}makepro.sed
  278.  
  279. tags: /tmp
  280. foo
  281. test -z "$F_bld_eq_src" -a -n "$C_SRCDIR" && echo "    cd $C_SRCDIR"
  282. cat <<foo
  283.     ctags *.[cy]
  284.  
  285. # I hate this next line
  286. \$(OBJS): ${C_BLDDIR}config.h ${C_BLDDIR}signals.h ${C_SRCDIR}zsh.h ${C_SRCDIR}zle.h ${C_SRCDIR}ztype.h ${C_SRCDIR}funcs.h
  287.  
  288. ${C_BLDDIR}params.o: ${C_SRCDIR}version.h
  289.  
  290. ${C_SRCDIR}makepro.sed:
  291.     \$(CO) \$(COFLAGS) ${C_SRCDIR}makepro.sed
  292.  
  293. clean:
  294. foo
  295. test $C_SRCDIR && echo "    cd $C_SRCDIR"
  296. cat <<'foo'
  297.     rm -f $(OBJS) $(ZSHPATH) core
  298.  
  299. spotless:    clean
  300. foo
  301. test -z "$F_bld_eq_src" -a -n "$C_SRCDIR" && echo "    cd $C_SRCDIR"
  302. cat <<foo
  303.     rm -f \$(PROTO) Makefile ${C_BLDDIR}signals.h ${C_BLDDIR}config.h
  304.  
  305. install: ${C_BLDDIR}zsh
  306. foo
  307. test -z "$F_bld_eq_src" -a -n "$C_SRCDIR" && echo "    cd $C_SRCDIR"
  308. cat <<foo
  309.     install -s -m 755 ${C_BLDDIR}zsh \$(BINDIR)
  310.     install -m 444 ${C_SRCDIR}../man/zsh.1 \$(MANDIR)/zsh.1
  311. foo
  312. )
  313. fi
  314.  
  315. ###
  316.